#include<stdio.h>

int FindMax(int *src, int n, int *p);

int main()
{
    int N, maximum = 0;
    int num[11];
    scanf("%d", &N);

    for(int i = 0; i < N; i ++)
    {
        scanf("%d", &num[i]);
    }

    int place = FindMax(num, N, &maximum);

    printf("%d %d", maximum, place);
}

int FindMax(int *src, int n, int *p)
{
    int place = 0, i;
    int max = src[0];
    
    for(i = 1; i < n; i ++)
    {
    	if(src[i] > max)
    	{
    		max = src[i];
    		place = i;
    	}
    }
	*p = max;
	
    return place;
}
